home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / GEN32.PAK / GLOBALS.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  7KB  |  182 lines

  1. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright (C) 1993-1995  Microsoft Corporation.  All Rights Reserved.
  7. //
  8. // PURPOSE:
  9. //    Contains declarations for all globally scoped names in the program.
  10. //
  11.  
  12. //-------------------------------------------------------------------------
  13. // Functions for handling main window messages.  The message-dispatching
  14. // mechanism expects all message-handling functions to have the following
  15. // prototype:
  16. //
  17. //     LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
  18.  
  19. // **TODO**  Add message-handling function prototypes here.  Be sure to
  20. //           add the function names to the main window message table in
  21. //           generic.c.
  22.  
  23. LRESULT MsgCommand(HWND, UINT, WPARAM, LPARAM);
  24. LRESULT MsgDestroy(HWND, UINT, WPARAM, LPARAM);
  25.  
  26.  
  27. //-------------------------------------------------------------------------
  28. // Functions for handling main window commands--ie. functions for
  29. // processing WM_COMMAND messages based on the wParam value.
  30. // The message-dispatching mechanism expects all command-handling
  31. // functions to have the following prototype:
  32. //
  33. //     LRESULT FunctionName(HWND, WORD, WORD, HWND);
  34.  
  35. // **TODO**  Add message-handling function prototypes here.  Be sure to
  36. //           add the function names to the main window command table in
  37. //           generic.c.
  38.  
  39. LRESULT CmdExit(HWND, WORD, WORD, HWND);
  40. LRESULT CmdAbout(HWND, WORD, WORD, HWND);
  41.  
  42.  
  43. //-------------------------------------------------------------------------
  44. // Global function prototypes.
  45.  
  46. // **TODO**  Add global function prototypes here.
  47.  
  48. BOOL InitApplication(HINSTANCE, int);
  49. BOOL CenterWindow(HWND, HWND);
  50.  
  51.     // Callback functions.  These are called by Windows.
  52.  
  53. // **TODO**  Add new callback function prototypes here.
  54.  
  55. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  56.  
  57.  
  58. //-------------------------------------------------------------------------
  59. // Command ID definitions.  These definitions are used to associate menu
  60. // items with commands.
  61.  
  62. // **TODO**  Add IDs for all menu commands here.  Be sure that the IDs you
  63. //           add are also added to the main window command table in generic.c
  64. //           and the menu statements in the resource file.
  65.  
  66. // File menu
  67. #define IDM_EXIT    1000
  68.  
  69. // Help menu
  70. #define IDM_ABOUT   1100
  71.  
  72. //-------------------------------------------------------------------------
  73. // String Table ID definitions.
  74.  
  75. #define IDS_APPNAME     1
  76. #define IDS_DESCRIPTION 2
  77.  
  78. //-------------------------------------------------------------------------
  79. //  About dialog defines.
  80.  
  81. #define IDD_VERFIRST    100
  82. #define IDD_VERLAST     104
  83.  
  84.  
  85. //-------------------------------------------------------------------------
  86. // Global variable declarations.
  87.  
  88. extern HINSTANCE hInst;          // The current instance handle
  89. extern char      szAppName[];    // The name of this application
  90. extern char      szTitle[];      // The title bar text
  91.  
  92. // **TODO**  For NON-MDI applications, uncomment line 1 below and comment
  93. //           line 2.  For MDI applications, uncomment line 2 below, comment
  94. //           line 1, and then define hwndMDIClient as a global variable in
  95. //           INIT.C
  96. #define hwndMDIClient NULL        /* (1) Stub for NON-MDI applications. */
  97. // extern HWND hwndMDIClient;     /* (2) For MDI applications.          */
  98.  
  99.  
  100. //-------------------------------------------------------------------------
  101. // Message and command dispatch infrastructure.  The following type
  102. // definitions and functions are used by the message and command dispatching
  103. // mechanism and do not need to be changed.
  104.  
  105.     // Function pointer prototype for message handling functions.
  106. typedef LRESULT (*PFNMSG)(HWND,UINT,WPARAM,LPARAM);
  107.  
  108.     // Function pointer prototype for command handling functions.
  109. typedef LRESULT (*PFNCMD)(HWND,WORD,WORD,HWND);
  110.  
  111.     // Enumerated type used to determine which default window procedure
  112.     // should be called by the message- and command-dispatching mechanism
  113.     // if a message or command is not handled explicitly.
  114. typedef enum
  115. {
  116.    edwpNone,            // Do not call any default procedure.
  117.    edwpWindow,          // Call DefWindowProc.
  118.    edwpDialog,          // Call DefDlgProc (This should be used only for
  119.                         // custom dialogs - standard dialog use edwpNone).
  120.    edwpMDIChild,        // Call DefMDIChildProc.
  121.    edwpMDIFrame         // Call DefFrameProc.
  122. } EDWP;                // Enumeration for Default Window Procedures
  123.  
  124.     // This structure maps messages to message handling functions.
  125. typedef struct _MSD
  126. {
  127.     UINT   uMessage;
  128.     PFNMSG pfnmsg;
  129. } MSD;                 // MeSsage Dispatch structure
  130.  
  131.     // This structure contains all of the information that a window
  132.     // procedure passes to DispMessage in order to define the message
  133.     // dispatching behavior for the window.
  134. typedef struct _MSDI
  135. {
  136.     int  cmsd;          // Number of message dispatch structs in rgmsd
  137.     MSD *rgmsd;         // Table of message dispatch structures
  138.     EDWP edwp;          // Type of default window handler needed.
  139. } MSDI, FAR *LPMSDI;   // MeSsage Dipatch Information
  140.  
  141.     // This structure maps command IDs to command handling functions.
  142. typedef struct _CMD
  143. {
  144.     WORD   wCommand;
  145.     PFNCMD pfncmd;
  146. } CMD;                 // CoMmand Dispatch structure
  147.  
  148.     // This structure contains all of the information that a command
  149.     // message procedure passes to DispCommand in order to define the
  150.     // command dispatching behavior for the window.
  151. typedef struct _CMDI
  152. {
  153.     int  ccmd;          // Number of command dispatch structs in rgcmd
  154.     CMD *rgcmd;         // Table of command dispatch structures
  155.     EDWP edwp;          // Type of default window handler needed.
  156. } CMDI, FAR *LPCMDI;   // CoMmand Dispatch Information
  157.  
  158.     // Message and command dispatching functions.  They look up messages
  159.     // and commands in the dispatch tables and call the appropriate handler
  160.     // function.
  161. LRESULT DispMessage(LPMSDI, HWND, UINT, WPARAM, LPARAM);
  162. LRESULT DispCommand(LPCMDI, HWND, WPARAM, LPARAM);
  163.  
  164.     // Message dispatch information for the main window
  165. extern MSDI msdiMain;
  166.     // Command dispatch information for the main window
  167. extern CMDI cmdiMain;
  168.  
  169.  
  170.  
  171. //-------------------------------------------------------------------------
  172. // Version string definitions--Leave these alone.
  173.  
  174. #define SZRCOMPANYNAME "CompanyName"
  175. #define SZRDESCRIPTION "FileDescription"
  176. #define SZRVERSION     "FileVersion"
  177. #define SZRAPPNAME     "InternalName"
  178. #define SZRCOPYRIGHT   "LegalCopyright"
  179. #define SZRTRADEMARK   "LegalTrademarks"
  180. #define SZRPRODNAME    "ProductName"
  181. #define SZRPRODVER     "ProuctVersion"
  182.